﻿import request from '/@/utils/request';
enum Api {
  AddEquipTag = '/api/equipTag/add',
  DeleteEquipTag = '/api/equipTag/delete',
  UpdateEquipTag = '/api/equipTag/update',
  GetEquipTagPage = '/api/equipTag/page',
  GetEquipTagType='/api/equipTag/type',
  ExportEquipTagTemplate = '/api/equipTag/template',
  ImportEquipTag = '/api/equipTag/import',
  ExportEquipTag = '/api/equipTag/export',
  GetPlcTagDataPage='/api/equipTag/pageData',
  WriteEquipTag='/api/equipTag/writeTag'
}
		// 分页查询PlcTagService
		export const getPlcTagPageDataList = (params?: any) => 
		request({
				url: Api.GetPlcTagDataPage,
				method: 'get',
				data: params,
			});

			// 写入点位
export const WriteEquip = (params?: any) =>
request({
	url: Api.WriteEquipTag,
	method: 'post',
	data: params,
});
// 增加设备点位
export const addEquipTag = (params?: any) =>
	request({
		url: Api.AddEquipTag,
		method: 'post',
		data: params,
	});

// 删除设备点位
export const deleteEquipTag = (params?: any) => 
	request({
			url: Api.DeleteEquipTag,
			method: 'post',
			data: params,
		});

// 编辑设备点位
export const updateEquipTag = (params?: any) => 
	request({
			url: Api.UpdateEquipTag,
			method: 'post',
			data: params,
		});

// 分页查询设备点位
export const getEquipTagPageList = (params?: any) => 
	request({
			url: Api.GetEquipTagPage,
			method: 'get',
			data: params,
		});
		// 查询点位类型
		export const getEquipTagTypes = () => 
		request({
				url: Api.GetEquipTagType,
				method: 'get'
				
			});
		
//下载点位导入模板
export const exportEquipTagTemplate = () => 
request({
	url: Api.ExportEquipTagTemplate,
	method: 'get'
	
});
//导入点位
export const importEquipTag = (params:any) => 
request({
	url: Api.ImportEquipTag,
	method: 'post',
	data: params.formData,
	headers: params.headers
}).then(response => { console.log(response.data); });

//导出点位
export const  exportEquipTag = (params?: any)  => 
request({
	url: Api.ExportEquipTag,
	method: 'get',
	data: params,
});
